﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;

#pragma warning disable IDE1006 // 命名样式
public class text : MonoBehaviour
#pragma warning restore IDE1006 // 命名样式
{
    // obj.GetComponent<Button>().onClick.AddListener(delegate () { this.Btn_Key(obj); });
    private void Awake()
    {
        GetComponent<Button>().onClick.AddListener(delegate () { this.OnClick(); });
        EventTriggerListener.Get(gameObject).onEnter = OnButtonEnter;
    }
    void OnClick()
    {
        Debug.Log("OnClick");
    }
    private void OnButtonEnter(GameObject go)
    {
        //在这里监听按钮的点击事件
        if (go == gameObject)
        {
            Debug.Log("DoSomeThings");
        }
    }
}
